import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:top_foundation/top_foundation.dart';

import 'index.dart';
import 'widgets/widgets.dart';

class UnreadPage extends GetView<UnreadController> {
  const UnreadPage({Key? key}) : super(key: key);

  // 主视图
  Widget _buildView() {
    return ListView(
      children: [
        RedDotContainer(
          child: Container(
            width: 50,
            height: 50,
            color: Colors.blueAccent,
          ),
        ),
        OutlinedButton(
          onPressed: () {},
          child: Text('outline'),
          style: ButtonStyle(
              backgroundColor: MaterialStatePropertyAll(Colors.amber),
              foregroundColor: MaterialStatePropertyAll(Colors.red),
              overlayColor: MaterialStatePropertyAll(Colors.blue),
              shadowColor: MaterialStatePropertyAll(Colors.pink),
              surfaceTintColor: MaterialStatePropertyAll(Colors.brown),
              shape: MaterialStatePropertyAll(
                RoundedRectangleBorder(
                  side: BorderSide(color: Colors.red, width: 0.5),
                  borderRadius: BorderRadius.circular(5),
                ),
              ),
              side: MaterialStateBorderSide.resolveWith(
                  (states) => BorderSide(color: Colors.purple, width: 0.5))),
        ),
        TextButton(onPressed: () {}, child: Text('text')),
        MaterialButton(
          onPressed: null,
          color: Colors.blue,
          disabledColor: Colors.grey,
          textColor: Colors.white,
          enableFeedback: true,
          elevation: 0,
          focusElevation: 0,
          child: Row(
            children: [
              Text('111'),
            ],
          ),
        ),
      ],
    );
  }

  @override
  Widget build(BuildContext context) {
    return GetBuilder<UnreadController>(
      builder: (_) {
        return Scaffold(
          appBar: AppBar(title: const Text("unread")),
          body: SafeArea(
            child: _buildView(),
          ),
        );
      },
    );
  }
}
